package com.example.haojiutao.service;



import com.example.haojiutao.common.Result;
import com.example.haojiutao.model.domain.Collect;

import java.util.List;

public interface CollectService {


    /*
     * @Description: 根据,userid查看收藏该商品
     * @Author: ma_lihong
     * @CreateTime: 2024/2/1 16:27
     * @param: userId
     * @return: com.example.haojiutao.common.Result
     **/
    List<Collect> findByUserId(Integer userId);


    /*
     * @Description: 根据goods_id 删除收藏记录
     * @Author: ma_lihong
     * @CreateTime: 2023/10/17 16:29
     * @param: id
     * @return: int
     **/
    int deleteCollect(int id);

    /*
     * @Description: 收藏商品
     * @Author: ma_lihong
     * @CreateTime: 2024/1/31 17:00
     * @param: collect
     * @return: com.example.haojiutao.common.Result
     **/
    Result addCollect(Collect collect);


    /*
     * @Description: 查询用户所有收藏
     * @Author: ma_lihong
     * @CreateTime: 2024/2/2 16:29
     * @param: collect
     * @return: com.example.haojiutao.common.Result
     **/
    List<Collect> selectCollect(Collect collect);

    /*
     * @Description: 收藏商品
     * @Author: ma_lihong
     * @CreateTime: 2024/2/1 16:27
     * @param: collect
     * @return: com.example.haojiutao.common.Result
     **/
    Collect findCollect(int userId, int goodsId);

    /*
     * @Description: 收藏更新
     * @Author: ma_lihong
     * @CreateTime: 2024/1/31 17:00
     * @param: collect
     * @return: com.example.haojiutao.common.Result
     **/
    void updateCollectStatus(Integer id);

    /*
     * @Description: 根据,goodsId查看收藏该商品的信息
     * @Author: ma_lihong
     * @CreateTime: 2024/2/1 16:27
     * @param: goodsId
     * @return: com.example.haojiutao.common.Result
     **/
    List<Collect> getByGoodsId(int goodsId);

    /*
     * @Description: 获取收藏数
     * @Author: ma_lihong
     * @CreateTime: 2024/2/1 16:27
     * @param: userId
     * @return: com.example.haojiutao.common.Result
     **/
    Integer getCountByGoodsId(int goodsId);
}
